<cfcomponent>

	<cffunction name="init" output="false" access="public" returntype="DeleteRecord" hint="I perform initialization for this component">
		<cfargument name="KalendarDAO" type="any" required="true" hint="I am the Kalendar Data Abstraction"/>
	
			<cfset variables.instance.KalendarDAO = arguments.KalendarDAO />
		
		<cfreturn this />	
	</cffunction>
	
	<cffunction name="execute" output="false" access="public" returntype="boolean" hint="I execute this command">
		<cfargument name="KalendarEvent" type="any" required="true"/>
		<cfargument name="UserMsg" type="any" required="true" >
		<cfset var returnState = false />
		
		<!--- <cftransaction action="begin"> --->
	
			
			<!--- Try to add the record --->
			<cfif getKalendarDAO().delete( arguments.KalendarEvent ) >
				<cfset arguments.UserMsg.addSuccess("Event Deleted") />
			<cfelse>
				<!--- Adding the record didnt' work. Make a note of it and just get out of this function. --->
				<cfset arguments.UserMsg.addError("Delete Event Failed") />
				<cfreturn false />
			</cfif>
	
		<!--- </cftransaction> --->
		
		<cfset returnState = true >

		<cfreturn returnState />
		
	</cffunction>


	
	<cffunction name="getKalendarDAO" access="private" output="false" returntype="any">
		<cfreturn variables.instance.KalendarDAO />
	</cffunction>
	
</cfcomponent>